import request from '@/utils/request'

export function login(data) {
  console.log(data);
  return request({
    url: '/userservice/user/login',
    method: 'post',
    /*封装成json格式传递给后台*/
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/userservice/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/userservice/user/logout',
    method: 'post'
  })
}

export function getUserList(current,size,data) {
  return request({
    url: `/userservice/tb-user/findUserPage/${current}/${size}`,
    method: 'post',
    /*封装成json格式传递给后台*/
    data
  })
}


export function addUserList(data) {
  return request({
    url: `/userservice/tb-user/addUser`,
    method: 'post',
    data
  })
}


export function delUserList(id) {
  return request({
    url: `/userservice/tb-user/${id}`,
    method: 'delete',
  })
}


export function updUserList(data) {
  return request({
    url: `/userservice/tb-user/updById`,
    method: 'put',
    data
  })
}



export function downloadUserList(tbUserVO) {
  return request({
    url: `/userservice/tb-user/export`,
    method: 'post',
    data: tbUserVO,
    responseType: 'blob'
  })
}
export function updStatus(id,status) {
  return request({
    url: `/userservice/tb-user/updStatus`,
    method: 'put',
    params: {id,status}
  })
}



